package com.blb.ssm.controller;

import java.util.UUID;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;

import com.blb.ssm.entity.Goods;
import com.blb.ssm.service.ShopService;

@Controller
@RequestMapping("/shop")
public class ShopController {
	
	@Autowired
	private ShopService shopService;
	
	@RequestMapping("")
	public String shop(){
		return "shoping";
	}
	
	@RequestMapping("/add")
	public String add(Goods goods){

		goods.setGid(UUID.randomUUID().toString());
		shopService.add(goods);
		return "shoping";
	}
}
